]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: Reset the search display when there's no search terms
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 30 Sep 2014 06:22:14 +0000 (00:22 -0600)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 30 Sep 2014 06:55:01 +0000 (00:55 -0600)
Destroy the previous search view when there's no search terms, to make
sure old search items don't show up.

js/ui/search.js

index 709484dae084e5dea99580cd8573b0c5459a33d8..d2ecd91aa8fd557d3d61ccdef5ab36c05a8d23e2 100644 (file)
@@ -459,6 +459,17 @@ const SearchResults = new Lang.Class({
         }
     },
 
+    _reset: function() {
+        this._terms = [];
+        this._results = {};
+        this._clearDisplay();
+        this._clearSearchTimeout();
+        this._defaultResult = null;
+        this._startingSearch = false;
+
+        this._updateSearchProgress();
+    },
+
     _doSearch: function() {
         this._startingSearch = false;
 
@@ -493,7 +504,7 @@ const SearchResults = new Lang.Class({
         this._cancellable.reset();
 
         if (terms.length == 0) {
-            this._clearSearchTimeout();
+            this._reset();
             return;
         }